#include<stdio.h>
#include<stdlib.h>
int main()
{
	FILE *fp;
	char ch;	
	fp = fopen("data1.txt", "w");
	printf("Input a string:\n");
	scanf("%c", &ch);
	while (ch != '\n')
	{
		ch=getchar();
	 if(ch>='a'&&ch<='z')
	 {
		putchar(ch-32);
		putchar('\n');
	 }
		fputc(ch, fp);
		scanf("%c", &ch);
	}
	fclose(fp);
	fp = fopen("data1.txt", "r");
	ch = fgetc(fp);
	while (ch!= EOF)
	{
		printf("%c", ch);
		ch = fgetc(fp);
	}	
	printf("\n");
	fclose(fp);
	return 0;
}